﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LumenLiquid.Debug;
using NHibernate;

namespace LumenLiquid.Database
{
    internal sealed class DatabaseDebugger:EmptyInterceptor
    {
        private string _database;

        public DatabaseDebugger(string database)
        {
            _database = database;
        }

        public override NHibernate.SqlCommand.SqlString OnPrepareStatement(NHibernate.SqlCommand.SqlString sql)
        {
            DebugHandler.Log("\"" + sql + "\" in database " + _database,DebugHandler.EDebugLevel.Sql);
            return sql;
        }
    }
}
